Add support for excluding a list of parameters from an API response#163
Merged
Add support for excluding a list of parameters from an API response#163
Conversation
shwstppr
approved these changes
Jul 24, 2025
Contributor
shwstppr
left a comment
There was a problem hiding this comment.
LGTM.
(test) 🐱 > list zones exclude=zonetoken,id
{
"count": 2,
"zone": [
{
"allocationstate": "Enabled",
"allowuserspecifyvrmtu": false,
"asnrange": "",
"dhcpprovider": "VirtualRouter",
"dns1": "10.147.28.6",
"guestcidraddress": "10.1.1.0/24",
"hasannotations": false,
"internaldns1": "10.147.28.6",
"ismultiarch": false,
"isnsxenabled": false,
"localstorageenabled": false,
"name": "zim1",
"networktype": "Advanced",
"routedmodeenabled": true,
"routerprivateinterfacemaxmtu": 1500,
"routerpublicinterfacemaxmtu": 1500,
"securitygroupsenabled": false,
"tags": [],
"type": "Core"
},
{
"allocationstate": "Enabled",
"allowuserspecifyvrmtu": false,
"asnrange": "",
"dhcpprovider": "VirtualRouter",
"dns1": "10.147.29.6",
"guestcidraddress": "10.1.2.0/24",
"hasannotations": false,
"internaldns1": "10.147.29.6",
"ismultiarch": false,
"isnsxenabled": false,
"localstorageenabled": false,
"name": "zim2",
"networktype": "Advanced",
"routedmodeenabled": true,
"routerprivateinterfacemaxmtu": 1500,
"routerpublicinterfacemaxmtu": 1500,
"securitygroupsenabled": false,
"tags": [],
"type": "Core"
}
]
}
Others can comment if the parameter name can be improved. Though this works too
Contributor
|
@Pearl1594 can we name the new param - |
Member
I feel "exclude" is fine @shwstppr, we already have another field "filter" to filter (default include) out the given names. filterexclude does not feel the right word to me. my 2cents. |
DaanHoogland
approved these changes
Aug 5, 2025
Contributor
DaanHoogland
left a comment
There was a problem hiding this comment.
clgtm, tested and works in isolation, we will have to decide whether to merge this and revisit #164 or vice versa
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR address ##149, it adds an exclude parameter to remove fields from the response
For example, without the exclude parameter, the listAccounts response looks like:
With this patch, if user wants to remove
userfield from the response, they could do so using the exclude param: